import request from '@/utils/request'

// 查询配料信息列表
export function listMixIngredients(query) {
  return request({
    url: '/quality/mixIngredients/list',
    method: 'get',
    params: query
  })
}

export function siloMixIngredients(query) {
  return request({
    url: '/quality/mixIngredients/siloList',
    method: 'get',
    params: query
  })
}

// 查询配料信息列表(分页)
export function pageMixIngredients(query) {
  return request({
    url: '/quality/mixIngredients/page',
    method: 'get',
    params: query
  })
}

// 查询配料信息详细
export function getMixIngredients(id) {
  return request({
    url: '/quality/mixIngredients/get/' + id,
    method: 'get'
  })
}

// 新增配料信息
export function addMixIngredients(data) {
  return request({
    url: '/quality/mixIngredients/add',
    method: 'post',
    data: data
  })
}

// 修改配料信息
export function updateMixIngredients(data) {
  return request({
    url: '/quality/mixIngredients/edit',
    method: 'post',
    data: data
  })
}

// 删除配料信息
export function delMixIngredients(id) {
  return request({
    url: '/quality/mixIngredients/remove/' + id,
    method: 'post'
  })
}


export function ingredientCalculator(data) {
  return request({
    url: '/quality/mixIngredients/ingredientCalculator',
    method: 'post',
    data: data
  })
}

export function ingredientCalculatorCost(data) {
  return request({
    url: '/quality/mixIngredients/ingredientCalculatorCost',
    method: 'post',
    data: data
  })
}
